import * as echarts from "echarts";

export function plotLine(chartInst:echarts.ECharts, x:(string|number)[], y:number[], title:string="")
{
    let option = {
      title: {
          text:title
        },
      xAxis: {
        type: 'category',
        data: x
      },
      yAxis: {
        type: 'value'
      },
      series: [
        {
          data: y,
          type: 'line',
          smooth: true
        }
      ],
    };
    
    option && chartInst.setOption(option); 
}